< previous page page_622 next page >

Page 622
When you run the application and click the command button, you'll see the character perform this request. Finally, you can have the character speak to users by passing the required text to the Speak method, as follows:
MyAgent.Speak when in the course of human events
If your computer has sound capabilities, you'll hear as well as see the text as it's spoken (see Figure B.4).
12181-0622a.gif
Figure B.4.
Displaying the text as it's spoken.
Try putting a Speak statement into the code and running the application again. Then, when the character is displayed, just let the application run for a few minutes; the character will eventually run a built-in animation that shows it waiting for you to do something.
Using the Character in an Application
Wrap this all up by having the character do something useful in the application. To use the character properly, you'll want to position it at the appropriate control. For example, if you want the character to tell users how to display an entry, you would move the character to the Tree View list and have it tell users what to do. While the character is talking, you should have the application wait until it's done before continuing its execution. One way of making it easy to use the character is by creating a routine that actually calls the

 
< previous page page_622 next page >

If you like this book, buy it!